/**
 * Created by wenchuan on 2019/5/7.
 */
define(function () {

    var self,
        app = win.app,
        selectArg
    ;

    app.newModule({

        init: function () {
            self = this;
            self._super({
                _refreshAutoInit: true,
                _limit:20,
                _readyBefore: function () {
                    selectArg = self._pageParameters;
                }
            }, win);

        },
        _lazy: function () {
            this._super();
            // console.log(selectArg.item);
            if (selectArg.item.length == 0){
                app.showNoData($('.flex-content-center'),'无可选信息');
            }
        },
        _ready: function () {
            Vue.component('selectitem', {
                template: app.getByid(doc, 'selectitem-template'),
                props: {
                    model: Array
                },
                methods: {
                    select: function (v) {
                        selectArg.cb(v);
                        app.back(1);
                    }
                }
            });
            new Vue({
                el: app.getByid(doc, 'scroll1'),
                data: {
                    items: selectArg.item
                }
            });
        }
    });

});